class MrpBom {

  String? id;
  String? messageMainAttachmentId;
  String? code;
  String? active;
  String? type;
  String? productTmplId;
  String? productCode;//产品编号
  String? productName;//产品名称
  String? spec;//产品规格
  String? uomId;//计量单位
  String? uomName;//计量单位
  String? productId;
  String? productQty;
  String? productUomId;
  String? sequence;
  String? readyToProduce;
  String? pickingTypeId;
  String? companyId;
  String? consumption;
  String? createUid;
  String? createDate;
  String? writeUid;
  String? writeDate;

  MrpBom({
    this.id,
    this.messageMainAttachmentId,
    this.code,
    this.active,
    this.type,
    this.productTmplId,
    this.productCode,
    this.productName,
    this.spec,
    this.uomId,
    this.uomName,
    this.productId,
    this.productQty,
    this.productUomId,
    this.sequence,
    this.readyToProduce,
    this.pickingTypeId,
    this.companyId,
    this.consumption,
    this.createUid,
    this.createDate,
    this.writeUid,
    this.writeDate,
  });

  MrpBom copyWith({
    String? id,
    String? messageMainAttachmentId,
    String? code,
    String? active,
    String? type,
    String? productTmplId,
    String? productId,
    String? productQty,
    String? productUomId,
    String? sequence,
    String? readyToProduce,
    String? pickingTypeId,
    String? companyId,
    String? consumption,
    String? createUid,
    String? createDate,
    String? writeUid,
    String? writeDate,
  }) {
    return new MrpBom(
      id: id ?? this.id,
      messageMainAttachmentId: messageMainAttachmentId ?? this.messageMainAttachmentId,
      code: code ?? this.code,
      active: active ?? this.active,
      type: type ?? this.type,
      productTmplId: productTmplId ?? this.productTmplId,
      productId: productId ?? this.productId,
      productQty: productQty ?? this.productQty,
      productUomId: productUomId ?? this.productUomId,
      sequence: sequence ?? this.sequence,
      readyToProduce: readyToProduce ?? this.readyToProduce,
      pickingTypeId: pickingTypeId ?? this.pickingTypeId,
      companyId: companyId ?? this.companyId,
      consumption: consumption ?? this.consumption,
      createUid: createUid ?? this.createUid,
      createDate: createDate ?? this.createDate,
      writeUid: writeUid ?? this.writeUid,
      writeDate: writeDate ?? this.writeDate,
    );
  }

  @override
  String toString() {
    return '''MrpBom{
      id: id,
      messageMainAttachmentId: messageMainAttachmentId,
      code: code,
      active: active,
      type: type,
      productTmplId: productTmplId,
      productId: productId,
      productQty: productQty,
      productUomId: productUomId,
      sequence: sequence,
      readyToProduce: readyToProduce,
      pickingTypeId: pickingTypeId,
      companyId: companyId,
      consumption: consumption,
      createUid: createUid,
      createDate: createDate,
      writeUid: writeUid,
      writeDate: writeDate,
    }''';
  }

  @override
  bool operator ==(Object other) => identical(this, other) || (
      other is MrpBom &&
          runtimeType == other.runtimeType
          && id== other.id
          && messageMainAttachmentId== other.messageMainAttachmentId
          && code== other.code
          && active== other.active
          && type== other.type
          && productTmplId== other.productTmplId
          && productId== other.productId
          && productQty== other.productQty
          && productUomId== other.productUomId
          && sequence== other.sequence
          && readyToProduce== other.readyToProduce
          && pickingTypeId== other.pickingTypeId
          && companyId== other.companyId
          && consumption== other.consumption
          && createUid== other.createUid
          && createDate== other.createDate
          && writeUid== other.writeUid
          && writeDate== other.writeDate
   );


  factory MrpBom.fromMap(Map<String, dynamic> map) {
    return new MrpBom(
      id: map['id']!=false?map['id'].toString() as String?:"",
      messageMainAttachmentId: map['message_main_attachment_id']!=false?map['message_main_attachment_id'].toString() as String?:"",
      code: map['code']!=false?map['code'].toString() as String?:"",
      active: map['active']!=false?map['active'].toString() as String?:"",
      type: map['type']!=false?map['type'].toString() as String?:"",
      productTmplId: (map['product_tmpl_id']!=false && map['product_tmpl_id']["id"]!=false)?map['product_tmpl_id']["id"].toString() as String?:"",
      productCode: (map['product_tmpl_id']!=false && map['product_tmpl_id']["default_code"]!=false)?map['product_tmpl_id']["default_code"].toString() as String?:"",
      productName: (map['product_tmpl_id']!=false && map['product_tmpl_id']["name"]!=false)?map['product_tmpl_id']["name"].toString() as String?:"",
      spec: (map['product_tmpl_id']!=false && map['product_tmpl_id']["description"]!=false)?map['product_tmpl_id']["description"].toString() as String?:"",
      uomId: (map['product_tmpl_id']!=false&&map['product_tmpl_id']["uom_id"]!=false)?map['product_tmpl_id']["uom_id"][0].toString() as String?:"",
      uomName: (map['product_tmpl_id']!=false&&map['product_tmpl_id']["uom_id"]!=false)?map['product_tmpl_id']["uom_id"][1].toString() as String?:"",
      productId: map['product_id']!=false?map['product_id'].toString() as String?:"",
      productQty: map['product_qty']!=false?map['product_qty'].toString() as String?:"",
      productUomId: map['product_uom_id']!=false?map['product_uom_id'].toString() as String?:"",
      sequence: map['sequence']!=false?map['sequence'].toString() as String?:"",
      readyToProduce: map['ready_to_produce']!=false?map['ready_to_produce'].toString() as String?:"",
      pickingTypeId: map['picking_type_id']!=false?map['picking_type_id'].toString() as String?:"",
      companyId: map['company_id']!=false?map['company_id'].toString() as String?:"",
      consumption: map['consumption']!=false?map['consumption'].toString() as String?:"",
      createUid: map['create_uid']!=false?map['create_uid'].toString() as String?:"",
      createDate: map['create_date']!=false?map['create_date'].toString() as String?:"",
      writeUid: map['write_uid']!=false?map['write_uid'].toString() as String?:"",
      writeDate: map['write_date']!=false?map['write_date'].toString() as String?:"",
    );
  }

  Map<String, dynamic> toMap() {
    // ignore: unnecessary_cast
    return {
      'id': this.id,
      'messageMainAttachmentId': this.messageMainAttachmentId,
      'code': this.code,
      'active': this.active,
      'type': this.type,
      'productTmplId': this.productTmplId,
      'productId': this.productId,
      'productQty': this.productQty,
      'productUomId': this.productUomId,
      'sequence': this.sequence,
      'readyToProduce': this.readyToProduce,
      'pickingTypeId': this.pickingTypeId,
      'companyId': this.companyId,
      'consumption': this.consumption,
      'createUid': this.createUid,
      'createDate': this.createDate,
      'writeUid': this.writeUid,
      'writeDate': this.writeDate,
    } as Map<String, dynamic>;
  }

  List toDomainList() {
    List list = [
    ] as List;
    //if(list.length==0){
    //  list.add(['id','!=',null]);
    //}
    // ignore: unnecessary_cast
    return list;
  }

  Map<String, dynamic> toOdooMap() {
    // ignore: unnecessary_cast
    return {
      'id': this.id,
      'message_main_attachment_id': this.messageMainAttachmentId,
      'code': this.code,
      'active': this.active,
      'type': this.type,
      'product_tmpl_id': this.productTmplId,
      'product_id': this.productId,
      'product_qty': this.productQty,
      'product_uom_id': this.productUomId,
      'sequence': this.sequence,
      'ready_to_produce': this.readyToProduce,
      'picking_type_id': this.pickingTypeId,
      'company_id': this.companyId,
      'consumption': this.consumption,
      'create_uid': this.createUid,
      'create_date': this.createDate,
      'write_uid': this.writeUid,
      'write_date': this.writeDate,
    } as Map<String, dynamic>;
  }

//</editor-fold>

}